appServices.factory('mineModule', function ($q, $http, md5, HostConfig, Common,Logger,ionPlugins,ionNative) {
    // var url = HostConfig.getAPI() + '/userController';
    var api = HostConfig.getAPI();
    return {
        //订单的http服务；
        http:function(url, params){
            var deferred = $q.defer();
            $http({
                method: 'POST',
                url: api+"/"+url,
                params:params,
                headers: {
                    'Content-Type': 'application/json',
                },
                skipAuthorization: true
            }).success(function (success) {
                deferred.resolve(success);
            }).error(function (error) {
                deferred.reject(error);
            });
            return deferred.promise;
        },
        pay:function(url, params){//商城相关的阿里支付；  api.sh-centurylink.cn
            var deferred = $q.defer();
            $http({
                method: 'POST',
                // url:'http://mall.youfansoft.com/mall/am/payController/'+url,
                // url:"https://shcrapp.promni.cn/mall/am/payController/"+url,
                url:"https://api.sh-centurylink.cn/mall/am/payController/"+url,
                //  url:'http://10.0.0.4:8080/am/payController/'+url,//本地调试
                data:params,
                headers: {
                    'Content-Type': 'application/json'
//                  'Content-Type': 'application/x-www-form-urlencoded'
                },
                skipAuthorization: true
            }).success(function (success) {
                deferred.resolve(success);
            }).error(function (error) {
                deferred.reject(error);
            });
            return deferred.promise;
        },
        wx_web_pay:function(url,params){
            var deferred = $q.defer();
            $http({
                method: 'POST',
                // url:'https://shcrapp.promni.cn/mall/am/payController/'+url,
                url:'https://api.sh-centurylink.cn/mall/am/payController/'+url,
                // url:'http://10.0.0.4:8080/am/payController/'+url,
                data:params,
                headers: {
                    'Content-Type': 'application/json'
                },
                skipAuthorization: true
            }).success(function (success) {
                deferred.resolve(success);
            }).error(function (error) {
                deferred.reject(error);
            });
            return deferred.promise;
        },
        
        //停车场服务
        park_serve:function(url,params){
            var deferred = $q.defer();
            $http({
                method: 'POST',
                // url:'https://shcrapp.promni.cn/mall/am/parkController/'+url,//正式服
                url:'https://api.sh-centurylink.cn/mall/am/parkController/'+url,//正式服
                // url:'http://10.0.0.4:8080/am/parkController/'+url,//正式服
                // url:'http://mall.youfansoft.com/mall/am/parkController/'+url,//本地调试
                params:params,
                headers: {
                    'Content-Type': 'application/json'
                },
                skipAuthorization: true
            }).success(function (success) {
                deferred.resolve(success);
            }).error(function (error) {
                deferred.reject(error);
            });
            return deferred.promise;
        },
        park_serve_1:function(url,params){//包括停车场支付宝支付
            var deferred = $q.defer();
            $http({
                method: 'POST',
                // url:'https://shcrapp.promni.cn/mall/am/parkController/'+url,//正式服
                url:'https://api.sh-centurylink.cn/mall/am/parkController/'+url,//正式服
                // url:'http://10.0.0.4:8080/am/parkController/'+url,//正式服
                // url:'http://mall.youfansoft.com/mall/am/parkController/'+url,//本地调试
                data:params,
                headers: {
                    'Content-Type': 'application/json'
                },
                skipAuthorization: true
            }).success(function (success) {
                deferred.resolve(success);
            }).error(function (error) {
                deferred.reject(error);
            });
            return deferred.promise;
        },

    }
});
